Skip to main content

Elementary Applications of Lagrangian Mechanics

This page contains elementary applications of Lagrangian mechanics to simple systems. These systems are difficult to analyze using Newtonian mechanics, but the Lagrangian formalism greatly simplifies the analysis.

Table of Contents

Shortest Path Between Two Points

The shortest path between two points in a plane is a straight line. Can we prove this? This might seem like an insanely obvious statement, but it is nevertheless an interesting subject of study. We can use the Lagrangian formalism to prove this statement.

The key is that the shortest path between two points is the path that minimizes the length of the path. We can create a path between two points by defining a function that describes the path, where we can think of as time. Suppose this path lives in two-dimensional space, so .

Let the total distance of the path be . (Recall that we use square brackets to denote functionals, which are functions of functions.) It is the sum of the infinitesimal distances along the path:

where we used the chain rule to write . Therefore, the Lagrangian of the system is:

Since does not explicitly depend on or , we automatically have that . This means that the Euler-Lagrange equations simplify to:

The first equation gives:

If the derivative of a function is zero, the function is a constant. Therefore, we have:

The same argument for the second equation gives:

Dividing Equation by Equation gives:

where is a constant. Rearranging gives . Then, integrating both sies by gives:

where is a constant. This is the equation of a straight line. Therefore, the shortest path between two points is a straight line.

Crucially, this proof does not rely on Newtonian mechanics. I made an emphasis on the previous page about deriving the Euler-Lagrange equations without explicitly relying on any specific expression for the Lagrangian. This shows that the equations hold for any Lagrangian, which includes this one for the shortest path.

Double Pendulum

The double pendulum is a simple system that exhibits chaotic behavior. It consists of two pendulums attached to each other, with the second pendulum attached to the first one's bob. We shall derive the equations of motion for the double pendulum using the Lagrangian formalism.

This will be a very long and tedious derivation, so you can skip some of the mathematical details if you want.

The double pendulum consists of two pendulums attached to each other. The first pendulum has length and mass , and the second pendulum has length and mass . The first pendulum is attached to the ceiling, and the second pendulum is attached to the first pendulum's bob. The angles of the first and second pendulums with the vertical are and , respectively, and the gravitational acceleration is .

If we use Newtonian mechanics, we would have to find all the forces, including the tension in the strings. This is very difficult, as the tension in the strings depends on the angles of the pendulums. We would have to do a lot of vector algebra to find the forces. Instead, we shall use the Lagrangian formalism, which is much simpler for this system because we simply need the energies of the system.

We have two sets of coordinates we can use: the Cartesian coordinates of the bobs or the angles of the pendulums. We can use both for now, but we shall write everything in terms of the angles in the end.

From the figure above, we can derive the following coordinate transformations:

The rates of change of these coordinates are, by the chain rule:

The velocity of the first bob is:

The velocity of the second bob is:

where we used the trigonometric identity .

With both velocities, we can find the kinetic energy of the system, which is the sum of the kinetic energies of the bobs:

The potential energy of the system is the sum of the potential energies of the bobs:

With the kinetic and potential energies, we can find the Lagrangian of the system:

Recall that in Lagrangian mechanics, we introduce the canonical momenta conjugate to the generalized coordinates as . As such, the momenta are:

Equations of Motion

The equations of motion are given by the Euler-Lagrange equations:

The term is just the time derivative of the momenta, . This we have:

The time derivatives of the first conjugate momentum is:

More details, please 🥺

That was a bit complicated and some details were skipped. The difficult part is the time derivative of the cosine term .

First, we need to use the product rule. I have colored the terms to make it easier to see which terms are multiplied together:

Now, we need to find the time derivative of the cosine term. This is tricky - both and are functions of time, so we need to use the multivariable chain rule. It is a bit clearer if we draw a diagram of the causal relationships:

As such, the change in is given by the sum of the contributions from and :

Putting it all together, we have:

This is the result we used in Equation .

The time derivative of the second conjugate momentum is:

Finally, the partial derivatives of the Lagrangian with respect to the generalized coordinates are:

Putting it all together, the first equation of motion for is:

Some terms cancel out, and dividing by gives:

The second equation of motion for is:

Some terms cancel out, and dividing by gives:

As such, we have fully derived the equations of motion for the double pendulum:

Equations of Motion for the Double Pendulum

These are quite messy at the moment, but we will simplify them (actually, we are just hiding the details) a bit here. First, let's divide both sides of both equations such that the coefficients of and are 1 in the first and second equations, respectively. Then, we rearrange to put the terms with on the right hand side:

We shall introduce some auxiliary functions for these coefficients and the terms on the right hand side (which are colored in the equations above):

Then, we can write the equations of motion as:

Using matrices, we can write these equations as a single matrix equation:

Denote the matrix on the left hand side as .

It turns out that is always invertible because the determinant of is always non-zero. The inverse of is:

Applying to both sides of Equation , we get:

Lastly, we shall write the equations of motion in terms of the angles and their angular velocities. This means that we shall expand our vector to include the angular velocities:

The derivative of is:

Defining the functions and as:

All of this gives the final equations of motion for the double pendulum:

Equations of Motion for the Double Pendulum: For a double pendulum with masses and , lengths and , and angles and with the vertical, the equations of motion are:

where:

and is the acceleration due to gravity.

This equation is nonlinear and there is currently no known general analytical solution for it given any initial conditions. Of course, some special cases can be solved analytically, but they pertain to specific initial conditions. For example, the most trivial case is when the pendulums are at rest, i.e., and . This does not mean that we do not know how the double pendulum behaves - solving a differential equation is only one way to understand a system.

The simulation at the top of the page shows the behavior of the double pendulum. It uses a 4th-order Runge-Kutta method to solve the equations of motion numerically. The double pendulum exhibits chaotic behavior, which means that small changes in the initial conditions can lead to drastically different outcomes.

Systems like the double pendulum are very interesting; while they are simple to describe, they exhibit very complex behavior. They are the subject of study in the field of nonlinear dynamics, which studies how systems behave when they are not linear.

Summary and Next Steps

In this section, we have applied the Lagrangian formalism to two systems: the shortest path between two points and the double pendulum.

The shortest path between two points was a simple example to show how the Lagrangian formalism can be used to derive the equations of motion. We showed that the shortest path is a straight line, which is a result that does not rely on Newtonian mechanics.

The double pendulum was a more complex example that showed how the Lagrangian formalism can be used to derive the equations of motion for a system with multiple degrees of freedom. The equations of motion for the double pendulum are nonlinear and exhibit chaotic behavior.

In the next section, we will explore a very important concept in classical mechanics: conservation laws.